//
//  UtilsDefine.h
//  rxtd_bdd
//
//  Created by 陈利群 on 15/4/11.
//  Copyright (c) 2015年 陈利群. All rights reserved.
//

#ifndef rxtd_bdd_UtilsDefine_h
#define rxtd_bdd_UtilsDefine_h

//百度地图
#define AppKey_BaiduMap @"kcBMkfxxexo8877VwSxt0GOWLdVuGQpU"
#define AppKey_NewbetaBaiduMap @"D81ZMPypCegWYGUINN2574K3YMvOrsbR"
//极光推送
#define AppKey_JiguangPush @"e9df9d8c47c94aafedc7e385"
#define AppKey_JiguangPushNew @"80e1021e19e0687f6862f6dc"
//讯飞语音
#define AppKey_KeDaXunFei @"5872f98e"
//配置是否是beta版本
//#define ISBETA

//是否启用安全评估模块，注释掉不加密
#define USE_SECURE_MODULE

//------------服务器地址---------------------------------------------

#ifdef DEBUG

//URL地址
#define HTTP_BASEURL @"http://test.cargocn.cn/cargocn/"
//支付接口
#define HTTP_PAY_BASEURL @"http://test.cargocn.cn/cargocn-cloud-pay/driverPay/"
//找货/询价接口
#define HTTP_FINDGOODS_BASEURL @"http://test.cargocn.cn/cargocn-cloud-EnqiryQuotation/App/Quote/"

////URL地址
//#define HTTP_BASEURL @"http://test.cargocn.cn/cargocn/"
////支付接口
//#define HTTP_PAY_BASEURL @"http://test.cargocn.cn/cargocn-cloud-pay/driverPay/"
////找货/询价接口
//#define HTTP_FINDGOODS_BASEURL @"http://test.cargocn.cn/cargocn-cloud-EnqiryQuotation/App/Quote/"

#define IsProduction NO

#else

#define IsProduction YES

//URL地址
#define HTTP_BASEURL @"https://http://test.cargocn.cn/cargocn/"
//支付接口
#define HTTP_PAY_BASEURL @"https://http://test.cargocn.cn/cargocn-cloud-pay/driverPay/"
//找货/询价接口
#define HTTP_FINDGOODS_BASEURL @"https://http://test.cargocn.cn/cargocn-cloud-EnqiryQuotation/App/Quote/"

////URL地址
//#define HTTP_BASEURL @"http://test.cargocn.cn/cargocn/"
////支付接口
//#define HTTP_PAY_BASEURL @"http://test.cargocn.cn/cargocn-cloud-pay/driverPay/"
////找货/询价接口
//#define HTTP_FINDGOODS_BASEURL @"http://test.cargocn.cn/cargocn-cloud-EnqiryQuotation/App/Quote/"



#endif

//app store url
#define APP_STORE_URL @"https://itunes.apple.com/us/app/id1204728638?mt=8"

#ifdef DEBUG
#define MITLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define MITLog(format, ...)
#endif
// 屏蔽输出
#ifdef DEBUG
#define SLog(format, ...) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String] )
#else
#define SLog(format, ...)
#endif
#ifdef DEBUG
#   define ILog(fmt, ...) {NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);}
#   define DLog(...) NSLog(__VA_ARGS__)
#   define ELog(err) if(err) ILog(@"%@", err)}




#else
#   define ILog(...)
#   define DLog(...) /* */
#   define ELog(err)

#endif

// ALog always displays output regardless of the DEBUG setting
#define ALog(fmt, ...) {NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);};




// 取系统版本，e.g.  4.0 5.0
#define kSystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]

// 屏幕大小
#define kScreenFrame [UIApplication sharedApplication].keyWindow.frame
//[UIScreen mainScreen].applicationFrame

// 是否iphone5
#define kIsIphone5 [UIScreen mainScreen].applicationFrame.size.height > 500

#define MyAppDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]

// 判断string是否为空 nil 或者 @"" 或者 (null)；
#define IsNilString(__String) ([__String isKindOfClass:[NSNull class]] || __String==nil || [__String isEqualToString:@""] || [[__String stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@""])

//蓝色按钮颜色
/**
 土灰色背景
 */
#define KBACKGROUNDCOLOR  @"#f7f7f7"
/**
 蓝色导航，按钮文字颜色
 */
#define KNAVCOLOR  @"#1cb7ff"
/**
 橘黄色提示文字
 */
#define KORANGECOLOR  @"#ff9773"
/**
淡蓝色文字title
 */
#define KTITLECOLOR  @"#1cb7ff"
//颜色转换

//淡蓝色
//#define KBLUECOLOR RGBCOLOR(18, 139, 220)
#define KBLUECOLOR RGBCOLOR(53, 125, 238)
//灰色
#define  KGRAYColor RGBACOLOR(139,139,139,0.6)

#define LabelTitleColor RGBCOLOR(70, 70, 70)

#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]


//RGB color macro
#define UIColorFrom0xRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
//RGB color macro with alpha
#define UIColorFrom0xRGBWithAlpha(rgbValue,a) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]


#endif
